package com.zhuiyi.springbootmybatis.service.impl;

import com.zhuiyi.springbootmybatis.entity.Product;
import com.zhuiyi.springbootmybatis.mapper.ProductMapper;
import com.zhuiyi.springbootmybatis.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    private ProductMapper productMapper;

    @Override
    public List<Product> getProducts() {
        return productMapper.getProducts();
    }

    @Override
    public boolean addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public boolean delereProductById(int id) {
        return productMapper.delereProductById(id);
    }

    @Override
    public boolean updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public Product getProductById(int id) {
        return productMapper.getProductById(id);
    }
}
